package com.maimao.auth.model;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * 认证后的用户
 * @author MaoLin Wang
 * @date 2020/11/30 11:21 上午
 */
public class SysAuthUser extends User {
    private String id;


    /**
     * 数据库中角色类型
     */
    private String type;

    /**
     * member或company
     */
    private String role;

    private String avatar;

    private Long shopId;

    private String realName;

    public SysAuthUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
    }

    public SysAuthUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    @Override
    public String toString() {
        return "SysAuthUser{" +
                "id='" + id + '\'' +
                ", type='" + type + '\'' +
                ", role='" + role + '\'' +
                ", avatar='" + avatar + '\'' +
                ", shopId=" + shopId +
                ", realName='" + realName + '\'' +
                '}';
    }
}
